package com.demo.oauth2jFinalShiroClient.config;

import java.util.HashMap;
import java.util.Map;

import com.demo.oauth2jFinalShiroClient.util.CacheMap;

public class HomeOAuth2Config {
	public static final String CLIENT_CODE_CALLBACK_URL = "http://localhost:8080/oAuth2jFinalShiroClient/oauth2/callBack";
	public static final String OAUTH_STATE_SESSION_ATTR_NAME = "oauth_state";	//state信息存放在session中，用于比较请求和响应的state是否一致
	public static final String OAUTH_ACCESS_TOKEN_SESSION_ATTR_NAME = "access_token";
	public static final String OAUTH_CONFIG_SESSION_ATTR_NAME = "oauth_config";
	//[key,value]=[state,OAuth2Config]
	//[state,OAuth2Config]信息存放在session中，用于从回调请求中提取state，进一步提取配置信息
	public static final CacheMap<String, OAuth2Config> STATE_CONFIG_MAP = new CacheMap<String, OAuth2Config>();

	//[key,value]=[channel,OAuth2Entity]
	public static final Map<String, OAuth2Config> CONFIG_MAP = new HashMap<>();
	static {
		//netease
		NeteaseOAuth2Config neteaseOAuth2Config = new NeteaseOAuth2Config();
		CONFIG_MAP.put(neteaseOAuth2Config.getChannel(), neteaseOAuth2Config);
		//其他
		
	}
}
